Skip to content

Add CRL creation to FFI - #5166

Merged
randombit merged 1 commit into
randombit:masterfrom
arckoor:x509-crl-ffi
Mar 2, 2026
Merged

Add CRL creation to FFI#5166
randombit merged 1 commit into
randombit:masterfrom
arckoor:x509-crl-ffi

Conversation

@arckoor

@arckoor arckoor commented Nov 21, 2025

Copy link
Copy Markdown
Contributor

Adds methods to create, update and view CRLs to the FFI.
CRL part of #4877.

Comment thread doc/api_ref/ffi.rst Outdated
@coveralls

coveralls commented Nov 21, 2025

Copy link
Copy Markdown

Coverage Status

coverage: 90.342% (+0.009%) from 90.333%
when pulling 457353a on arckoor:x509-crl-ffi
into 5166623 on randombit:master.

Comment thread src/lib/ffi/ffi_cert.cpp

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds CRL (Certificate Revocation List) creation, updating, and viewing functionality to Botan's FFI, enhancing the library's X.509 certificate management capabilities. The changes include new FFI functions for CRL operations, corresponding Python bindings, comprehensive tests, and documentation.

Key Changes

  • Added FFI functions for CRL creation (botan_x509_crl_create), updating (botan_x509_crl_update), and inspection
  • Implemented Python wrapper classes (X509CRL, X509CRLReason, X509CRLEntry) with methods for CRL operations
  • Introduced FFI API version 20260203 for Botan 3.11.0

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/lib/ffi/ffi_cert.h New internal header declaring FFI certificate/CRL structure types
src/lib/ffi/ffi_cert.cpp Implementation of CRL creation, update, viewing, and inspection functions
src/lib/ffi/ffi.h Public FFI API declarations for new CRL functions and reason code enum
src/lib/ffi/ffi.cpp FFI version support registration for API 20260203
src/lib/ffi/info.txt Updated FFI version constant and added internal header
src/tests/test_ffi.cpp C++ tests for CRL creation, updating, and verification
src/tests/data/x509/crl/ca.crt Test CA certificate for CRL testing
src/tests/data/x509/crl/sub1.crt Test subordinate certificate 1 for CRL testing
src/tests/data/x509/crl/sub2.crt Test subordinate certificate 2 for CRL testing
src/python/botan3.py Python bindings with X509CRL class, reason enum, and entry class
src/scripts/test_python.py Python tests for CRL creation, revocation, and verification
doc/api_ref/ffi.rst Documentation for new CRL-related FFI functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/python/botan3.py Outdated
Comment thread src/scripts/test_python.py Outdated
Comment thread src/lib/ffi/ffi_cert.cpp Outdated
Comment thread doc/api_ref/ffi.rst Outdated
Comment thread src/lib/ffi/ffi_cert.cpp Outdated
Comment thread doc/api_ref/ffi.rst Outdated
@arckoor
arckoor force-pushed the x509-crl-ffi branch 2 times, most recently from 22c282f to 7f9f2a1 Compare December 14, 2025 12:55
@arckoor

arckoor commented Dec 27, 2025

Copy link
Copy Markdown
Contributor Author

@randombit I have removed the dependency on the python doc, so this is now a standalone PR. I hope this makes it a bit easier to take a look here.

@randombit randombit left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the rebase that helps a lot. Generally looks fine, I think though for the CRL entry getters we'll go with the approach added in #5220. It's probably easiest to just rebase this PR onto #5220 (or alternately wait for #5220 to merge then rebase onto master, which is a bit slower but likely to be less aggravating since there is a lot of FFI work going in at once for 3.11 it seems)

Comment thread doc/api_ref/ffi.rst Outdated
Comment thread doc/api_ref/ffi.rst Outdated
Comment thread src/lib/ffi/ffi_cert.cpp
@randombit randombit added this to the Botan 3.11 milestone Jan 10, 2026

@reneme reneme left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Frankly, I didn't realize that this PR had so much overlap with our work on #5220 and #5188. I'm sorry to barge in like that after it's been open for like six weeks. 😨

Anyway, I think we should ensure that the APIs for reading and writing CRLs are aligning nicely. I added some suggestions below.

Please note that despite having merged #5220 already, I don't consider those changes to be set in stone before they make it into a release. I'm definitely open to re-evaluate them as needed.

Comment thread src/lib/ffi/ffi.h Outdated
Comment thread src/lib/ffi/ffi.h
Comment thread src/lib/ffi/ffi.h
Comment thread src/lib/ffi/ffi.h Outdated
@arckoor
arckoor force-pushed the x509-crl-ffi branch 3 times, most recently from 6d666d2 to 4098d59 Compare January 11, 2026 20:35
Comment thread src/tests/test_ffi.cpp Outdated
@arckoor
arckoor force-pushed the x509-crl-ffi branch 2 times, most recently from 5ef7637 to a34fc29 Compare January 13, 2026 22:01
Comment thread src/python/botan3.py Outdated
Comment thread src/lib/ffi/ffi_cert.cpp
Comment thread src/python/botan3.py Outdated
@arckoor
arckoor requested a review from reneme January 21, 2026 08:52
@arckoor
arckoor requested a review from randombit January 21, 2026 08:52
@arckoor
arckoor force-pushed the x509-crl-ffi branch 2 times, most recently from 49cda16 to d1b6188 Compare January 27, 2026 14:03
@arckoor
arckoor requested a review from Copilot January 27, 2026 14:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread doc/api_ref/ffi.rst Outdated
Comment thread doc/api_ref/ffi.rst Outdated
Comment thread src/lib/ffi/ffi.h Outdated
Comment thread src/lib/ffi/ffi.h Outdated
Comment thread src/python/botan3.py Outdated
@arckoor
arckoor force-pushed the x509-crl-ffi branch 6 times, most recently from fb08294 to 8ad6b5c Compare January 27, 2026 16:09
Comment thread src/tests/test_ffi.cpp
Comment on lines +835 to +836
TEST_FFI_OK(botan_x509_crl_update,
(&new_crl, empty_crl, rng, ca_cert, ca_key, now, 86400, crl_entries, 1, nullptr, nullptr));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to test this with ..., crl_entries, 2, ..., but asan won't let me (which is fair). In local testing it did return a ERR_NULL_POINTER like I expected though.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/python/botan3.py Outdated
@arckoor
arckoor force-pushed the x509-crl-ffi branch 2 times, most recently from 7fd01f9 to 457353a Compare February 22, 2026 16:29

@randombit randombit left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks @arckoor

@reneme did you have any final comments?

@reneme reneme left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me too. Thanks for adapting this to the botan_x509_crl_entry_t construction. Nice to see that this is now all concise. :)

@randombit
randombit merged commit 1afa1b1 into randombit:master Mar 2, 2026
88 of 89 checks passed
@arckoor
arckoor deleted the x509-crl-ffi branch March 24, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants